<!DOCTYPE html>
<html lang="en">
<head>
    <title>分类 我的博客</title>
{{template "header"}}
</head>
<body>
{{template "nav" .}}

<div class="container ">
    <br>
    <h1>分类列表</h1>
    <form method="get" action="/category">
        <div class="form-group">
            <label>分类名称</label>
            <input id="uname" type="text" class="form-control" placeholder="Account" name="name" required>
        </div>
        <input type="hidden" name="op" value="add">
        <button type="submit" class="btn btn-default">添加</button>

    </form>

    <table class="table table-striped">
        <thead>
        <tr>
            <th>#</th>
            <th>名称</th>
            <th>文章数</th>
            <th>操作</th>
        </tr>
        </thead>
        <thead>
        {{range .Categories}}
        <tr>
            <td>{{.Id}}</td>
            <td>{{.Title}}</td>
            <td>{{.TopicCount}}</td>
            <td>
                <a href="/category?op=del&id={{.Id}}">删除</a>
            </td>
        </tr>
        {{end}}
        </thead>
    </table>
</div>

<script src="/static/js/jquery-1.10.2.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
</body>
</html>>



